package cn.jb698.codec.gorm.util;

import java.util.List;

import cn.jb698.codec.msm.generator.util.CodecGeneUtils;
import cn.jb698.codec.msm.generator.v5base.beans.BcrudConfigBean;
import cn.jb698.codec.msm.generator.v5base.beans.FileOutputTpltCfg;

/**
 * Gorm工具类 
 * @author LIU(LiuJianbin)
 * @date 2021-01-29
 */
public class CodecGormUtils {

	/**
	 * 
	 * @param configBean
	 * @param serviceFileOutputTpltCfgList
	 * @param tableBcrudBean
	 */
	public static void doAddGormServBcrudV5OutputTpltCfgToList(BcrudConfigBean configBean, List<FileOutputTpltCfg> serviceFileOutputTpltCfgList) {

		{
    		FileOutputTpltCfg gormModel_outputCfg = new FileOutputTpltCfg();
    		String tpltCode = "gorm_model";
    		String gormModel_tpltFileRes = "/cn/jb698/codec/gorm/v5base/bcrud/model/GormModel_Template_v5.vm";
    		String gormModel_outputFileDir = ("/internal/bcrud/"+"model"+"/") ; //  CodecGeneUtils.parseAndCombineDirStr("/internal/bcrud/","model");
    		String gormModel_outputFileName = "${modelJavaTypeName}" + ".go";
    		gormModel_outputCfg.setTpltCode(tpltCode);
    		gormModel_outputCfg.setTpltFileRes(gormModel_tpltFileRes);
    		gormModel_outputCfg.setOutputFileRelDir(gormModel_outputFileDir);
    		gormModel_outputCfg.setOutputFileName(gormModel_outputFileName);
    		serviceFileOutputTpltCfgList.add(gormModel_outputCfg);
        }
        {
        	FileOutputTpltCfg gormDao_outputCfg = new FileOutputTpltCfg();
        	String tpltCode = "gorm_dao";
        	String gormDao_tpltFileRes = "/cn/jb698/codec/gorm/v5base/bcrud/dao/GormDao_Template_v5.vm";
        	String gormDao_outputFileDir = ("/internal/bcrud/"+"dao") ; //  CodecGeneUtils.parseAndCombineDirStr("/internal/bcrud/","dao");
        	String gormDao_outputFileName = "${modelJavaTypeName}Dao" + ".go";
        	gormDao_outputCfg.setTpltCode(tpltCode);
        	gormDao_outputCfg.setTpltFileRes(gormDao_tpltFileRes);
        	gormDao_outputCfg.setOutputFileRelDir(gormDao_outputFileDir);
        	gormDao_outputCfg.setOutputFileName(gormDao_outputFileName);
        	serviceFileOutputTpltCfgList.add(gormDao_outputCfg);
        }
	}
	
}
